from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_apscheduler import APScheduler

login_manager = LoginManager()
db = SQLAlchemy()
migrate = Migrate(db=db)
scheduler = APScheduler()

@login_manager.user_loader
def load_user(user_id):
    from FileShare.models import User
    user = User.query.get(int(user_id))
    return user

login_manager.login_view = 'auth.login'
# login_manager.login_message = 'Your custom message'
login_manager.login_message_category = 'warning'

